Skip to content

fix(javascript): truncate meta string dispose list on write reset - #4015

Merged
chaokunyang merged 1 commit into
apache:mainfrom
ayush00git:fix/metastring-dispose-leak
Sep 3, 2026
Merged

fix(javascript): truncate meta string dispose list on write reset#4015
chaokunyang merged 1 commit into
apache:mainfrom
ayush00git:fix/metastring-dispose-leak

Conversation

@ayush00git

Copy link
Copy Markdown
Contributor

What was the error

MetaStringWriter.reset() restored each entry's dynamicWriteStringId but never truncated disposeMetaStringBytes. Since meta string owners re-push themselves on every root serialization of a named type, the list grew by every past root operation (an unbounded leak in long-running processes) and each reset walked the whole history.

What this PR fixes

reset() now truncates the list after restoring the ids, so it only ever holds the current root's entries. A regression test asserts the list stays at its baseline size across 100 root serializations.

MetaStringWriter.reset() restored each entry's dynamicWriteStringId but
never truncated the list, so every root serialization of a named type
re-pushed the same MetaStringBytes owners. The list grew by every past
root operation and each reset walked the whole history.
@chaokunyang
chaokunyang merged commit a18b41b into apache:main Sep 3, 2026
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants